/**
 * @Date 2021-01-15 15:09:39
 * @Remark
 */

// lib
import { GoEasyMessage } from "goeasy";
// config
// script & methods & public
import logUtils from "@/utils/logUtils";
import notification from "@/components/Notice/notification";
// http
// api
// interface && type && class
// 其它

// 推送监听处理
function messageListener(message: GoEasyMessage) {
  const str: string = message.content;
  try {
    const messageJson = JSON.parse(str);
    logUtils.info("push json", messageJson);
    notification.info("推送信息", messageJson);
  } catch (error) {
    logUtils.error("push json error", error);
  }
}

export default {
  messageListener,
};
